package de.hs.rm.UJAdapter.util;

import javax.management.ObjectName;
import javax.management.remote.JMXServiceURL;

public final class StringGenerationUtil {
	
	public static String getUDNfromDomainName(String domain)
	{
		domain = "uuid:JMX:MBeanDomain:" + domain;
		return domain;
	}
	
	public static String getServiceIDfromObjName(ObjectName objName)
	{
		String serviceID = "urn:JMX:serviceID:" + objName.toString();
		return serviceID;
	}
	
	public static String getServiceTypefromObjName(ObjectName objName)
	{
		String serviceType = objName.toString().substring(objName.getDomain().length() + 6);//scrap domainname and " type="
		serviceType = "urn:JMX:MBean:" + serviceType;
		return serviceType;
	}
	
	public static String getRootDeviceUDNfromServiceURL(JMXServiceURL serviceUrl)
	{
		String udn = "uuid:JMX:MBeanServer:" + serviceUrl;
		return udn;
	}

}
